package com.goldcn.user.controller;

import com.goldcn.common.util.IdGen;
import com.goldcn.user.model.ImcsConfig;
import com.goldcn.user.service.ImcsConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2017/9/13.
 */
@Api(value = "环信相关")
@RestController
@RequestMapping(value = "/imcs")
public class ImcsCongController {
    @Autowired
    ImcsConfigService imcsConfigService;

    @ApiOperation(value = "查询供应商的坐席")
    @RequestMapping(value = "/{supplierID}",method = RequestMethod.GET)
    public Object selectBySupplierID(@PathVariable Long supplierID)throws Exception{
        return imcsConfigService.selectBySupplierID(supplierID);
    }


    //开发者专用
    /*新增一个供应商配置*/
    @RequestMapping(value = "/dev/add",method = RequestMethod.POST)
    public Object devAdd(@RequestBody ImcsConfig imcsConfig)throws Exception{
        imcsConfig.setConfigID(IdGen.get().nextId());
        return imcsConfigService.insertSelective(imcsConfig);
    }


}
